<template>
	<view @click="click()">
		
			<u-notice-bar :text="set.direction=='row'?set.text:noticeList"
			:direction="set.direction"
			:icon="set.icon==1?'volume':''"
			:mode="set.close==1?'closable':''"
			:color="set.color"
			:bgColor="set.bgColor"
			:speed="set.speed"
			></u-notice-bar>
		
		
	</view>
</template>

<script>
	export default {
		name:"diy-notice-bar",
		data() {
			return {
				noticeList:[]
			};
		},created() {
			if(this.set.direction=='column'){
				if(this.moxi.length(this.set.notice_list)){
					for(let k in this.set.notice_list){
						this.noticeList.push(this.set.notice_list[k].title)
					}
				}
			}
		},
		props:{
			 set:{
				type:Object,
			 	default(){
					return {
					     notice_list:{},
						 speed:300,
						 direction:"column",
						 description:"2000",//垂直滚动的延迟周期
						 close:1,//是否显示关闭按钮
						 icon:1,//是否显示左侧图标
						 bgColor:"#fdf6ec",
						 color:"#f9ae3d"
					}
				}
			 }
		},methods:{
			click(){
				if(this.set.url.length){
					this.navto(this.set.url);
				}
			}
		}
	}
</script>

<style>

</style>